import React, { useEffect, useRef, useState } from "react";
import { history, connect } from 'umi'
import { Tree, } from 'antd';

const Categories = (props) => {
  const { list, selectedKeys, setSelectedKeys, } = props
  const onSelect = (keys, info) => {
    const { selected
    } = info
    if (selected) {
      setSelectedKeys(keys)
    }
  };
  return <div className="MateriaTabel_box">
    <Tree
      fieldNames={{ title: 'categoryName', key: 'id', children: 'subMaterialCategoryList' }}
      blockNode
      selectedKeys={selectedKeys}
      defaultExpandAll={true}
      onSelect={onSelect}
      treeData={list}
    />
  </div>
}
export default connect(({ loading }) => ({
  loading: loading.effects['liveStreaming/fakeDropMaterialCategory'],
}))(Categories);  